'''
Created on 2010-12-14

@author: Administrator
'''

import wx

class RefactorFrame(wx.Frame):
  def __init__(self, parent, id):
    wx.Frame.__init__(self, parent, id, 'Refactor Example', size=(340,200))
    panel = wx.Panel(self, -1)
    panel.SetBackgroundColour('white')
    
    # Create Buttons
    firstButton = wx.Button(panel, -1, "First")
    prevButton = wx.Button(panel, -1, "<< Preview", pos=(80,0))
    nextButton = wx.Button(panel, -1, "Next >>", pos=(160,0))
    lastButton = wx.Button(panel, -1, "Last", pos=(240,0))
    
    self.Bind(wx.EVT_BUTTON, self.OnFirst, firstButton)
    self.Bind(wx.EVT_BUTTON, self.OnPrev, prevButton)
    self.Bind(wx.EVT_BUTTON, self.OnNext, nextButton)
    self.Bind(wx.EVT_BUTTON, self.OnLast, lastButton)
    
    # Create Menu
    menuBar = wx.MenuBar()
    menu1 = wx.Menu()
    openMenuItem = menu1.Append(-1, "Open", "Copy in status bar")
    quitMenuItem = menu1.Append(-1, "Quit", "Quit")
    self.Bind(wx.EVT_MENU, self.OnOpen, openMenuItem)
    self.Bind(wx.EVT_MENU, self.OnQuit, quitMenuItem)
    
    menuBar.Append(menu1, "File");
    
    menu2 = wx.Menu()
    copyItem = menu2.Append(-1, "Copy", "Copy")
    cutItem = menu2.Append(-1, "Cut", "Cut")
    pasteItem = menu2.Append(-1, "Paste", "Cut")
    self.Bind(wx.EVT_MENU, self.OnCopy, copyItem)
    self.Bind(wx.EVT_MENU, self.OnCut, cutItem)
    self.Bind(wx.EVT_MENU, self.OnPaste, pasteItem)
    menuBar.Append(menu2, "Edit")
    
    self.SetMenuBar(menuBar)
    
    # Create Text
    static1 = wx.StaticText(panel, wx.NewId(), "First Name", pos=(10, 50))
    static1.SetBackgroundColour("White")
    text1 = wx.TextCtrl(panel, wx.NewId(), "", size=(100,-1), pos=(80, 50))
    
    static2 = wx.StaticText(panel, wx.NewId(), "Last Name", pos=(10, 80))
    static2.SetBackgroundColour("White")
    text2 = wx.TextCtrl(panel, wx.NewId(), "", size=(100, -1), pos=(80, 80))
    
    
    
    
    
    self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
  
  def OnFirst(self, event): pass
  def OnPrev(self, event): pass
  def OnNext(self, event): pass
  def OnLast(self, event): pass
  def OnOpen(self, event): pass
  
  def OnCopy(self, event): pass
  def OnCut(self, event): pass
  def OnPaste(self, event): pass
  
  def OnQuit(self, event): 
    self.Close()
  
  def OnCloseWindow(self, event):
    self.Destroy()

if __name__ == '__main__':
  app = wx.PySimpleApp()
  frame = RefactorFrame(None, -1)
  frame.Show()
  app.MainLoop()
